home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 21.zip
/
BS1 part 21
/
Professional Page v4.0 (1993)(Gold Disk)(Disk 1 of 4)[HD].7z
/
Professional Page v4.0 (1993)(Gold Disk)(Disk 1 of 4)[HD].adf
/
rexx.lzh
/
counter.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1992-03-13
|
1KB
|
42 lines
/*
Counter.rexx Copyright Gold Disk Inc., February, 1992
This macro keeps a running counter. It is useful for enumerating values
such as lines, page numbers etc.
Use it in the following manner with mergecodes
a. First initialize a counter by calling the function with a new name
example: ««=counter.rexx(newname,1)»».
This will initialize a new counter named newname with a value of one.
When the ReplaceMergeCodes Genie is run, the entire string will be
replaced by the value of 1.
b. Call this function whenever the next value is needed:
Example:
*/
parse arg counter, init, incfunc
if init ~= '' then
do
val = init
call setclip(ppuser_counter||counter, init)
end
else
do
val = getclip(ppuser_counter||counter)
if val = '' then val = 0
end
if incfunc ~= '' then
call setclip(ppuser_func||counter, incfunc)
else
incfunc = getclip(ppuser_func||counter)
rval = val
if incfunc ~= '' then
interpret "val = val "incfunc
else
val = val + 1
call setclip(ppuser_counter||counter, val)
return(rval)